home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 01030300.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  7.6 KB  |  74 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Debugging</title><meta name="filename" content="text/sbasic/common/01030300"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle3{
  5.                 }
  6.         span.Tabelle3A{
  7.                 width:18cm;}
  8.         td.Tabelle3A1{
  9.                 }
  10.         table.Tabelle1{
  11.                 }
  12.         span.Tabelle1A{
  13.                 width:1.499cm;}
  14.         span.Tabelle1B{
  15.                 width:16.501cm;}
  16.         td.Tabelle1A1{
  17.                 }
  18.         table.Tabelle2{
  19.                 }
  20.         span.Tabelle2A{
  21.                 width:1.499cm;}
  22.         span.Tabelle2B{
  23.                 width:16.501cm;}
  24.         td.Tabelle2A1{
  25.                 }
  26.         p.P1{
  27.                 }
  28.         span.T1{
  29.                 font-weight:bold;}
  30.         span.fr1{
  31.                 }
  32.         span.fr2{
  33.                 }
  34.         </style></head><body>
  35.    
  36.    
  37.    <help:to-be-embedded Eid="basicfehler" xmlns:help="http://openoffice.org/2000/help"><a name="basicfehler"/>
  38.    <p class="Head1"><help:link Id="66471">Debugging</help:link></p>
  39.    <p class="Paragraph">The following describes how to find errors in your <help:productname>%PRODUCTNAME</help:productname> Basic programs.</p>
  40.    </help:to-be-embedded>
  41.    <p class="Paragraph">Complex projects in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic are especially prone to errors, no matter how careful you are. <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Basic provides several aids to help find errors in your programs, as described below:</p>
  42.    <p class="Head2">Breakpoints and Single Step Editing</p>
  43.    <p class="Paragraph">Single step editing enables you to check each command in your program for errors. In this way, errors can be easily localized since you are able to immediately see the result of each step. A pointer in the breakpoint column of the Editor indicates the current line. Moreover, you can set a breakpoint if you want to force the program to be interrupted at a specific position.</p>
  44.    <p class="Head3">How to Set a Breakpoint at a Program Line</p>
  45.    <p class="Paragraph">In the breakpoint column at the left of the Editor window, simply double-click to set a breakpoint at the corresponding line, or to delete an existing breakpoint. When the program reaches a breakpoint, the program execution is interrupted. You can then continue the program step-by-step with the <span class="T1">Single Step</span> icon.</p>
  46.    <p class="Paragraph">When the program comes to a SUB call during single step editing, click the <span class="T1">Single Step</span> icon to branch into the SUB. However, if you want skip over the single step editing and execute the SUB call like a normal Basic command, click the <span class="T1">Procedure Step</span> icon.</p>
  47.    <p class="Head3">Defining the Properties of a Breakpoint</p>
  48.    <p class="Paragraph">Click with the right mouse button on a breakpoint to open the context menu, and select <span class="T1">Active</span> to activate or deactivate the breakpoint. When a breakpoint is deactivated, it remains in place, but does not interrupt the program execution. Click <span class="T1">Properties</span> to open a dialog where you can define further options:</p>
  49.    <table><tr class=""><th class="Tabelle3A1" style="text-align:left;"><span class="Tabelle3A">
  50.        <p class="TextInTable"><draw:image draw:style-name="fr1" draw:name="Grafik1" text:anchor-type="paragraph" svg:width="9.234cm" svg:height="6.033cm" draw:z-index="2" xlink:href="66851" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  51.       </span></th></tr></table>
  52.    <p class="Paragraph"/>
  53.    <p class="Paragraph">The list box displays all existing <span class="T1">breakpoints</span> and the corresponding line number in the program. The line number where the respective breakpoint was defined is selected in the list. With the check box <span class="T1">Active</span> you can define whether or not the breakpoint should remain active.</p>
  54.    <p class="Paragraph">In the <span class="T1">Pass Count</span> field you can define how many times the breakpoint can be passed over before the program is interrupted. If you enter 0 (default setting) the program will always be interrupted as soon as a breakpoint is encountered.</p>
  55.    <p class="Paragraph">Click <span class="T1">Delete</span> to physically remove the breakpoint from the program.</p>
  56.    <p class="Head2">Observing the Behavior of Variables</p>
  57.    <p class="Paragraph">During single step editing you can display certain variables in the Watch window. To add a variable, either double-click a variable in the program code and click <span class="T1">Add Watch</span>, or type the variable name directly in the Watch text box and press Enter.</p>
  58.    <p class="Paragraph">The values of all variables in the current SUB or FUNCTION are displayed in the Watch window. If variables are displayed which are not defined locally for the current SUB or FUNCTION, a message appears ("Out of Scope") instead of the value.</p>
  59.    <p class="Paragraph">You can also include arrays in the Watch window. If you enter the name of an array variable without an index value in the Watch text box, the content of the entire array is displayed.</p>
  60.    <table><tr class=""><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  61.        <p class="TextInTable"><draw:image draw:style-name="fr2" draw:name="HIND_1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="66732" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  62.       </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  63.        <p class="TextInTable">You can click a variable <help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="MAC"/><help:default>while pressing (Alt)</help:default></help:switch> to modify its value at run-time (for test purposes).</p>
  64.       </span></th></tr></table>
  65.    <p class="Paragraph"/>
  66.    <table><tr class=""><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2A">
  67.        <p class="TextInTable"><draw:image draw:style-name="fr2" draw:name="HIND_2" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="1" xlink:href="66732" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  68.       </span></th><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2B">
  69.        <p class="TextInTable">If you rest the mouse above a valid (and predefined) variable in the Watch window at run-time, the content of the variable is displayed in a pop-up text box.</p>
  70.       </span></th></tr></table>
  71.    <p class="Paragraph"/>
  72.    <p class="Head2">Working with the Call Stack Window</p>
  73.    <p class="Paragraph">The call stack window is always active in single step editing. It provides an overview of the call hierarchy of SUBS or FUNCTIONS. The order of SUBS and FUNCTIONS enables you to determine which SUB called a subsequent SUB, and indicates which SUB will be called after the current SUB.</p>
  74.   </body></html>